Skip to content

Conversation

kirex0
Copy link
Contributor

@kirex0 kirex0 commented Oct 17, 2025

Public API Changes
None

Description
This PR fixes an issue with the linter during the build process. The following errors are thrown when trying to build this package.

/usr/local/share/.cache/yarn/v6/.tmp/daaec974064c5e8d044980d3e6858ff6.f25904a999239d9a8bb4e70561e27643b468a71d.prepare/src/urdf/UrdfBox.ts
  23:9  error  Prefer using an optional chain expression instead, as it's more concise and easier to read  @typescript-eslint/prefer-optional-chain
/usr/local/share/.cache/yarn/v6/.tmp/daaec974064c5e8d044980d3e6858ff6.f25904a999239d9a8bb4e70561e27643b468a71d.prepare/src/urdf/UrdfColor.ts
  35:9  error  Prefer using an optional chain expression instead, as it's more concise and easier to read  @typescript-eslint/prefer-optional-chain
/usr/local/share/.cache/yarn/v6/.tmp/daaec974064c5e8d044980d3e6858ff6.f25904a999239d9a8bb4e70561e27643b468a71d.prepare/src/urdf/UrdfMesh.ts
  29:9  error  Prefer using an optional chain expression instead, as it's more concise and easier to read  @typescript-eslint/prefer-optional-chain
/usr/local/share/.cache/yarn/v6/.tmp/daaec974064c5e8d044980d3e6858ff6.f25904a999239d9a8bb4e70561e27643b468a71d.prepare/src/urdf/UrdfUtils.ts
  10:7  error  Prefer using an optional chain expression instead, as it's more concise and easier to read  @typescript-eslint/prefer-optional-chain
  21:7  error  Prefer using an optional chain expression instead, as it's more concise and easier to read  @typescript-eslint/prefer-optional-chain

@MatthijsBurgh MatthijsBurgh requested a review from Copilot October 20, 2025 05:54
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes TypeScript ESLint warnings by modernizing conditional checks to use optional chaining syntax. The changes address linting errors that were preventing successful builds by replacing verbose null/undefined checks with more concise optional chain expressions.

  • Replaces explicit null checks with optional chaining for array length validation
  • Updates conditional statements across URDF parser classes to use modern JavaScript syntax
  • Maintains identical logic while improving code readability and satisfying linter requirements

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/urdf/UrdfUtils.ts Updated two conditional checks to use optional chaining for xyz and rpy array validation
src/urdf/UrdfMesh.ts Simplified scale array validation using optional chaining
src/urdf/UrdfColor.ts Updated rgba array validation to use optional chaining
src/urdf/UrdfBox.ts Simplified size array validation using optional chaining

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@MatthijsBurgh MatthijsBurgh merged commit 0bdae5c into RobotWebTools:develop Oct 20, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants